package objects.slots;

import objects.DataObject;
import objects.Field;
import objects.GruObject;

public class FieldSlot extends Slot {
	public GruObject object;
	public Field field;
	
	public FieldSlot( GruObject object, Field field ) {
		this.object = object;
		this.field = field;
	}

	@Override
	public void insert( DataObject value ) {
		object.fields[ field.index ] = value;
	}

	@Override
	public DataObject remove() {
		DataObject value = object.fields[ field.index ];
		object.fields[ field.index ] = null;
		return value;
	}
 }